#include <iostream>
using namespace std;

long long gcd(long long a, long long b) {
    return b == 0 ? a : gcd(b, a % b);
    // 求最大公约数，辗转相除法
}

bool isPrime(long long target) {
    for (long long i = 2; i * i <= target; i++) {
        if (!(target % i)) { return false; }
    }
    return true;
}

long long getMaxNotRepeatedFactors(long long target) {
    if (target == 1 || isPrime(target)) { return target; }
	for (long long i = 2; ; i++) {
        long long greatestCommonDiv = gcd(i, target);
        if (greatestCommonDiv != 1) {
            target /= greatestCommonDiv;
        }
        // 将原数拆解为多个因数
        if (target == 1) { return i; }
        /*
        if (i < target && isPrime(target)) {
            // 如果剩下的因数是一个质数，则直接返回之，不用做接下来的循环
            return target;
        }
        这个剪枝算法并不必要，但是加入了可以提升效率，你可以取消这一行的注释
        */
    }
    return -1;
    // 该算法并非我原创，我参考了：https://blog.csdn.net/weixin_35105950/article/details/117115648?app_version=6.1.7&csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22117115648%22%2C%22source%22%3A%22m0_54007497%22%7D&utm_source=app
}

int main() {
    long long target; cin >> target;
    long long result = getMaxNotRepeatedFactors(target);
    cout << result;
    return 0;
}